<?php
	include("../../app/View/Parts/left.ctp");
	
?>
	<div class="span9">
		<div class='btn btn-info pull-right add'><?php echo $this->Html->link('Add Page', array('action' => 'add')); ?></div>
	</div>
	<div class="br">&nbsp;</div>
	<div class="span9">
		<table width="100%" class="table-bordered table-striped" cellpadding="5">
			<thead>
			<tr bgcolor="#ccc">
				<th>Sl</th>
				<th>Page For</th>
				<th>Title</th>
				<th>Created</th>
				<th>Modified</th>
				<th>Action</th>
			</tr>
			</thead>
			<tbody>
			<?php
				$sl=0;
				foreach($Pages as $Page){
					$sl ++ ;
					if($sl%2==0){
						echo '
							<tr bgcolor="#E2E2E2">
								<td>'.$sl.'</td>
								<td>&nbsp;</td>
								<td>'.$Page['Page']['title'].'</td>
								<td>'.$Page['Page']['created'].'</td>
								<td>'.$Page['Page']['modified'].'</td>
								<td>'.$this->Html->link('Edit', array('action' => 'edit', $Page['Page']['id'])).' | '.$this->Form->postLink('Delete', array('action' => 'delete',$Page['Page']['id']),array('confirm' => 'Are you sure?')).'</td>
							</tr>
						';
					}else{
						echo '
							<tr>
								<td>'.$sl.'</td>
								<td>&nbsp;</td>
								<td>'.$Page['Page']['title'].'</td>
								<td>'.$Page['Page']['created'].'</td>
								<td>'.$Page['Page']['modified'].'</td>
								<td>'.$this->Html->link('Edit', array('action' => 'edit', $Page['Page']['id'])).' | '.$this->Form->postLink('Delete', array('action' => 'delete',$Page['Page']['id']),array('confirm' => 'Are you sure?')).'</td>
							</tr>
						';
					}
				}
			?>
			</tbody>
		</table>
			<div class="span12 margintop10">
			
				<div class="pagination">
					<?php
						echo $this->Paginator->prev( __('Previous'), array(), null, array('class' => 'prev disabled'));
						// Shows the page numbers
						echo $this->Paginator->numbers($options = array('separator'=>''));

						// Shows the next and previous links
						echo $this->Paginator->next(  __('Next'), array(), null, array('class' => 'next disabled'));
					?>
					<div class="counter">
					<?php
						// prints X of Y, where X is current page and Y is number of pages
						echo $this->Paginator->counter($options = array('tag'=>'span'));
					?>
					</div>
				</div>
						
			</div>
	</div>
<div style="clear:both;"></div>